import { CommonModal } from "@/views/components/CommonModal";
import SubTitle from "@/pages/OrderModule/common/components/SubTitle";
import { DialogEnum } from "../index";
import { SelectBatchInput } from "@/pages/OrderModule/orderList/components/Filter/components/SelectBatchInput";
import { Alert, message, Typography, Space, Button } from "antd";
import { useState } from "react";
import Style from "../../../index.module.less";
import { useNavigate } from "react-router-dom";
const { Link } = Typography;
const CreatSuccessModal = ({ codes = [], actionName, onCancel }) => {
	const navigate = useNavigate();
	const handleOk = () => {
		message.success("操作成功");
		onCancel();
	};
	return (
		<CommonModal
			title={{ title: "提示" }}
			open={Boolean(actionName === DialogEnum.CreatSuccess)}
			width="553px"
			// onOk={handleOk}
			onCancel={onCancel}
			footer={
				<div className="flx-justify-between">
					<span className={Style.text}>
						前往处理{" "}
						<Link
							onClick={() => {
								navigate("/views/purchase/PurchaseOrder?purchaseOrderNos=" + codes);
								onCancel();
							}}
							className={Style.text}
						>
							【采购单管理】
						</Link>
					</span>
					<div>
						<Button onClick={onCancel} style={{ width: "64px", height: "32px" }}>
							取消
						</Button>
						<Button type="primary" onClick={handleOk} style={{ width: "64px", height: "32px" }}>
							确定
						</Button>
					</div>
				</div>
			}
		>
			<SubTitle title={<span className={Style.text}>成功创建采购单</span>} as="s2" symbol />
			<div style={{ margin: "12px 0 24px 8px", width: 493, lineHeight: "20.5px" }}>{codes.join()}</div>
		</CommonModal>
	);
};
export default CreatSuccessModal;
